<template>
    <div id="TicketingInstructions">
        <NavBarTitle :NavBarTitle="NavBarTitle"/>
        <div class="txtF flex jCenter">
            <div class="txt">
                <div v-html="txt"></div>
            </div>
        </div>
        <Loading :isLoading="isLoading"/>
    </div>
</template>

<script>
    import Loading from 'components/Loading.vue'
    import NavBarTitle from 'components/NavBarTitle.vue'
    export default {
        data() {
            return {
                NavBarTitle:'购票须知',
                isLoading: true,
                txt: '',
            }
        },
        components: {
            NavBarTitle,
            Loading
        },
        methods: {},
        beforeMount() {
            this.NavBarTitle = this.$route.query.title;
            let buyor = ''
            if(this.$route.query.type == 'gou'){
                buyor = this.$api.home.buynotice;
            }else if(this.$route.query.type == 'tui'){
                buyor = this.$api.home.retreatnotice;
            }
            console.log(buyor);
            let data = {
                token: this.$store.state.token
            };
            this.$axios.post(this.$index+buyor,this.$Qs.stringify(data))
                .then((res) => {
                    console.log(res);
                    if(res.data.flag){
                        this.txt = res.data.data;
                        this.isLoading = false
                    }else {
                        this.$toast(res.data.msg)
                    }
                }).catch((err) => {
                console.log(err);
            })

        }

    }
</script>

<style scoped>
    .txtF{
        width: 100%;
    }
    .txt{
        width: 93.9%;
    }
</style>